home *** CD-ROM | disk | FTP | other *** search
- Var
-
- Source,Ziel1,Ziel2 : text[20000];
- Zeile : String[255];
- Count : Integer;
- oldfile : boolean;
-
- begin
- if paramcount > 3 then
- begin
- assign(Source,ParamStr(1));
- {$I-}reset(Source);{$I+}
-
- if IOResult = 0 then
- begin
- assign(Ziel1,ParamStr(2));
- rewrite(Ziel1);
-
- assign(Ziel2,ParamStr(3));
- rewrite(Ziel2);
-
- oldfile := true;
- Count := 0;
- write(#13' Zeilen ',ParamStr(2));
-
- repeat
- readln(Source,Zeile);
- if (copy(Zeile,9,8) = ParamStr(4)) and oldfile then
- begin
- oldfile := false;
- Count := 1;
- write(#13#10' Zeilen ',ParamStr(3));
- end;
-
- if oldfile then
- writeln(Ziel1,Zeile)
-
- else
-
- writeln(Ziel2,Zeile);
-
- Count := succ(Count);
- write(#13,Count);
-
- until eof(Source);
-
- writeln;
-
- close(Source);
- close(Ziel1);
- close(Ziel2);
- end
-
- else
-
- writeln(ParamStr(1),' nicht gefunden!');
-
- end
- else
- begin
- writeln('Fehlerhafte Parameterliste! Aufruf z.B. LOGTRENN Source Ziel1 Ziel2 Datum');
- end;
- end.